import request from '@/utils/request'

// 查询处方单列表
export function listHead(query) {
  return request({
    url: '/order/head/list',
    method: 'get',
    params: query
  })
}

// 审核处方
export function auditHead(data) {
  return request({
    url: '/order/head/audit',
    method: 'post',
    data: data
  })
}

// 查询处方单详细
export function getHead(id) {
  return request({
    url: '/order/head/' + id,
    method: 'get'
  })
}

// 新增处方单
export function addHead(data) {
  return request({
    url: '/order/head',
    method: 'post',
    data: data
  })
}

// 修改处方单
export function updateHead(data) {
  return request({
    url: '/order/head',
    method: 'put',
    data: data
  })
}

// 删除处方单
export function delHead(id) {
  return request({
    url: '/order/head/' + id,
    method: 'delete'
  })
}

// 导出处方单
export function exportHead(query) {
  return request({
    url: '/order/head/export',
    method: 'get',
    params: query
  })
}

// 获取下一张处方ID
export function getNextAuditId(id) {
  return request({
    url: `/order/head/getAuditOne/${id}`,
    method: 'get'
  })
}

// 保存处方查询条件
export function addQueryParam(data) {
  return request({
    url: '/order/head/addQueryParam',
    method: 'post',
    data: data
  })
}

// 查询处方查询条件
export function getQueryParam() {
  return request({
    url: '/order/head/getQueryParam',
    method: 'get'
  })
}

